import Vue from 'vue'
import VueI18n from 'vue-i18n'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import jaLocale from 'element-ui/lib/locale/lang/ja'
import esLocale from 'element-ui/lib/locale/lang/es'
import zh from './zh.js'
import en from './en.js'
import ja from './ja.js'
import es from './es.js'

Vue.use(VueI18n)

const i18n = {
  locale: localStorage.lang || 'zh',
  messages: {
    zh: {
      ...zh,
      ...zhLocale
    },
    en: {
      ...en,
      ...enLocale
    },
    ja: {
      ...ja,
      ...jaLocale
    },
    es: {
      ...es,
      ...esLocale
    }
  }
}
export default i18n
